<%@ Page Inherits="System.Web.Mvc.ViewPage<Ditto.Helpers.PaginatedList<Ditto.Models.Item>>" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" %>

<asp:Content ID="Title" ContentPlaceHolderID="TitleContent" runat="server">
	Popular Items
</asp:Content>

<asp:Content ID="Masthead" ContentPlaceHolderID="MastheadContent" runat="server">
	<% Html.RenderPartial("Masthead", false); %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div class='hslice' id='1' >
        <h2 class='entry-title'>Popular Items</h2>
        <a rel='feedurl' href='/Items/WebSliceUpcoming' style='display:none;' ></a>
        <ul class="upcomingitems">
    
            <% foreach (var item in Model) { %>
        
                <li>     
                    <%: Html.ActionLink(item.Title, "Details", "Items", new { id=item.ItemID }, null) %>
                    by
                    <%: Html.ActionLink(item.PostingUserID, "Details", "Users", new { id=item.PostingUserID }, null) %>
                    on 
                    <strong><%: item.TimeCreated.ToString("yyyy-MMM-dd")%> 
                    <%: item.TimeCreated.ToString("HH:mm tt")%></strong>
                    at 
                    <%: item.Address + " " + item.Country %>
                </li>
        
            <% } %>

        </ul>
    </div>

    <div class="pagination">

        <% if (Model.HasPreviousPage) { %>
        
            <%: Html.RouteLink("<<< Previous Page", 
                               "UpcomingItems", 
                               new { page=(Model.PageIndex-1) }) %>
        
        <% } %>
        
        <% if (Model.HasNextPage) { %>
        
            <%: Html.RouteLink("Next Page >>>", 
                               "UpcomingItems", 
                               new { page = (Model.PageIndex + 1) })%>
        
        <% } %>    

    </div>
    
</asp:Content>


